﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace INF7GEN
{
    [Serializable()]
    public class ADVBookFlag : ISerializable
    {
        private String name = "";
        private Boolean on = false;

        public ADVBookFlag ()
        {
            ;
        }


        //--------------------------------------------------------------------
        //Serialization-------------------------------------------------------
        public ADVBookFlag(SerializationInfo info, StreamingContext ctxt)
        {
            this.name = (string)info.GetValue("FLAGname", typeof(string));
            this.on = (Boolean)info.GetValue("FLAGOn", typeof(Boolean));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("FLAGname", this.name);
            info.AddValue("FLAGOn", this.on);
        }
        //-------------------------------------------------------------------






        public override string ToString()
        {
            return this.name;
        }


        /// <summary>
        /// if flag is currently on or true
        /// </summary>
        public bool On
        {
            get { return on; }
            set { on = value; }
        }

        /// <summary>
        /// Name of flag
        /// </summary>
        public String InternalName
        {
            get { return name; }
            set { name = value; }
        }



    }
}
